public class YW_DuckSimulator {

	public static void main(String[] args) {
		YW_DuckSimulator simulator = new YW_DuckSimulator();
		simulator.simulate();
	}
 
	void simulate() {
		YW_Quackable yw_MallardDuck = new YW_MallardDuck();
		YW_Quackable yw_RedheadDuck = new YW_RedheadDuck();
		YW_Quackable yw_DuckCall = new YW_DuckCall();
		YW_Quackable yw_RubberDuck = new YW_RubberDuck();
		YW_Quackable yw_GooseDuck = new YW_GooseAdapter(new YW_Goose());
		
		System.out.println("\nDuck Simulator: With Goose Adapter: Demo2");		
		simulate(yw_MallardDuck);
		simulate(yw_RedheadDuck);
		simulate(yw_DuckCall);
		simulate(yw_RubberDuck);
		simulate(yw_GooseDuck);
	}

	void simulate(YW_Quackable duck) {
		duck.quack();
	}
}
